<?php
namespace App\Models;
use Request;

/**
 * 日志类
 */
class MLog extends BaseModel
{
    public $table = "logs";

    /**
     * 记录一条日志
     */
    public static function log($intro)
    {
        $log = new MLog();
        $log->username = session('admin_name');
        $log->intro = $intro;
        $log->ip = Request::ip();
        $log->time = time();
        $log->super = session('admin_super');
        return $log->save();
    }
}